{% extends "services/services_base.html" %}
{% load i18n %}

{% block title %} {% trans "Services" %} -- {{ block.super }} {% endblock %}

{% block body_outer %}
<div class="page-header">
  {% if user.is_authenticated and not READ_ONLY_MODE %}
    <a href="{% url "register_service" %}" class="btn btn-primary pull-right">{% trans "Register a new Service" %}</a>
  {% endif %}
  <h2>{% trans "Remote Services" %}</h2>
</div>
<div class="twocol">
{% if services %}
<table class="table table-striped">
  <thead>
  	<th>{% trans "Title" %}</th>
  	<th>{% trans "URL" %}</th>
    <th>{% trans "Type" %}</th>
  </thead>
  {% for service in services %}
  <tr>
	<td><a href='{% url "service_detail" service.id %}'>{{ service.title }} <span class="badge">{{ service.layer_set.count }}</span></a></td>
	<td><a href='{{ service.base_url }}' target="_blank" rel="noopener noreferrer">{{ service.base_url }}</a></td>
    <td>{{ service.service_type }}</td>
  </tr>
  {% endfor %}
</table>
{% else %}
<h4>{% trans "No services registered" %}</h4>
{% endif %}
</div>
{% endblock %}
